import math

max = 1000000000000
# max = 210
def qudiao0(n):
    while n % 10 == 0:
        n /= 10
    return n

def jiequ5(n):
    return n % 1000000

def jisuan():
    start = 1

    x = 1
    while x <= max:
        cur = x
        start = start * cur
        start = qudiao0(start)
        # print x,jiequ5(start), jiequ5(qudiao0(math.factorial(x)))
        print x,jiequ5(start)
        x = x + 1
        
    print x,jiequ5(start)
            
jisuan()
